Core java - Interview Questions and Answers for 'Xactly corp' | Search Interview Question - javasearch.buggybread.com
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Core java - Interview Questions and Answers for 'Xactly corp' - 2 question(s) found
- Order By Newest
Very frequently asked. Usually asked with questions related to String. Frequently asked at CTS / Cognizant
Q1.
What is an Immutable Object ?
Core Java
Ans. Object that can't be changed after instantiation.
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 java   oops   immutable  immutability
Asked in 27 Companies
basic
 
frequent
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Try 2 Question(s) Test
Which of the following class creates mutable objects ?
Boolean
File
String
StringBuffer
Which of the following class creates immutable objects ?
String
StringBuffer
StringBuilder
None of these create immutable objects.
Related Questions
Why is String immutable in Java ?
Why Char array is preferred over String for storing password?
How does making string as immutable helps with securing information ? How does String Pool pose a security threat ?
How is string object immutable if we can concat a string to it ?
How to implement an immutable class ?
What is an immutable class ?
Does Declaring an object "final" makes it immutable ?
Is String final in Java ?
What are stateless objects ? How are they different from immutable objects ? Which of these two is thread safe ?
Q2.
Give an Example for Builder Pattern ?
Core Java
Ans. String str = new StringBuilder().append("Buggy").append("Bread").toString();
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 java   builder pattern   design pattern   stringbuilder   string
Asked in 3 Companies
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Try 1 Question(s) Test
With the following code, Which is a valid way to initialize ?
public class BuggyBread {
private String element1;
private String element2;
private BuggyBread(String element1, String element2){
this.element1 = element1;
this.element2 = element2;
}
public static class Builder {
private String element1;
private String element2;
Builder(BuggyBread buggybread){
element1 = buggybread.element1;
element2 = buggybread.element2;
}
Builder withElement1(String element1){
this.element1 = element1;
return this;
}
Builder withElement2(String element2){
this.element2 = element2;
return this;
}
BuggyBread build(){
BuggyBread buggybread = new BuggyBread(element1,element2);
return buggybread;
}
}
}
BuggyBread buggybread = new BuggyBread();
BuggyBread buggybread = new BuggyBread("element1","element2");
BuggyBread.Builder builder = new BuggyBread.Builder();
BuggyBread.Builder builder = new BuggyBread.Builder("element1","element2");
Related Questions
Explain the scenerios to choose between String , StringBuilder and StringBuffer ?
or
What is the difference between String , StringBuilder and StringBuffer ?
Difference between StringBuffer and StringBuilder ?
Which of the following has been introduced with Java 8 ? a. StringBuffer b. StringBuilder c. StringFilter d. StringJoiner
Can StringBuffer and StringBuilder in Java be inherited?
Do we have a method to reverse a string in String class ?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: